package com.example.scheduledtask.schedule;


import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;


//1.主要用于标记配置类，兼备Component的效果。
@Configuration
public class StaticTask {

    @Scheduled(cron = "0/5 * * * * ?")
    private void configureTasks() {
        System.err.println("你好,我是StaticTask定时任务，我每5秒执行一次，代码写在 com.example.scheduledtask.schedule.StaticTask.configureTasks()");
    }

}
